<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>律师事务所</title>
    <link rel="stylesheet" href="/css/index.css">
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/layui-v2.6.4/css/layui.css">
    <script src="/layui/layui.js"></script>
    <script src="/layui/jquery.min.js"></script>
    <script src="/layui/axios.min.js"></script>
</head>

<body>
	<div id="top">返回顶部</div>
    <!-- 头部 -->
    <div th:replace="common/common::head1"></div>
    <!-- 导航 -->
    <div th:replace="common/common::head2"></div>
    <!--横幅-->
    <div th:replace="common/common::head3"></div>
    <!-- 主体部分 -->
    <section class="main_body">
        <div class="container">
            <div class="ss">
                <div th:replace="common/common::head4"></div>
                <!-- 服务项目 -->
                <main class="cf ss_2 ">
                    <div class="sp">服务项目
                        <p>SERVICE</p>
                    </div>
                </main>
            </div>
        </div>
        <section class="container pic">
            <div class="pic_1">
                <div class="pic_2">
                    <img src="/images/service-1_sg54.jpg" alt="">
                </div>
                <div class="pic_3">
                    <ul>
                        <li>
                            <img src="/images/service-sub-1_tfeb.jpg" alt="" width="250px">
                            <a href="#">合同纠纷</a>
                        </li>
                        <li>
                            <img src="/images/service-sub-2.jpg" alt="" width="250px">
                            <a href="#">劳务纠纷</a>
                        </li>

                        <li>
                            <img src="/images/service-sub-3.jpg" alt="" width="250px">
                            <a href="#">房产纠纷</a>
                        </li>
                        <li>
                            <img src="/images/service-sub-4.jpg" alt="" width="250px">
                            <a href="#">股权纠纷</a>
                        </li>
                        <li>
                            <img src="/images/service-sub-5.jpg" alt="" width="250px">
                            <a href="#">知识产权</a>
                        </li>
                        <li>
                            <img src="/images/service-sub-6.jpg" alt="" width="250px">
                            <a href="#">借贷纠纷</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="bg"><img src="/images/index-p1-bg.png" alt=""></div>
        </section>
        <!-- 经典案例 -->
        <section class="container cf">
            <div class="classic_case">
                <main class="cf ss_2 ">
                    <div class="sp">经典案例
                        <p>SERVICE</p>
                    </div>
                </main>
                <div class="case_1" id="jdCases">

                </div>
                <div class="case_2">
                    <img src="/images/bg_l9wu.jpg" alt="" width="1200px" height="200px">
                    <button><a href="#" class="more">更多</a></button>
                </div>
            </div>
        </section>
        <section class="container cf">
            <!-- 新闻动态 -->
            <div class="news">
                <div class="new">
                    <p>新闻动态 <span>TEAM</span></p>
                    <span class="more1"><a href="">更多></a></span>
                    <div class="news_1" id="news">

                    </div>
                    <div id="demo20"></div>
                </div>
            </div>
            <!--<aside>
                <div class="order">
                    <div class="order_1">
                        <p>在线预约 <span>ORDER</span></p>
                    </div>
                    <form action="">
                        姓名：<input type="text" name="" id="" />
                        电话：<input type="text" name="" id="" />
                        内容：<textarea rows="5" cols="25" name="intro">
                            </textarea>
                        <button type="submit">提交</button>
                    </form>
                </div>
            </aside>-->
        </section>
    </section>
    <!-- 尾部 -->
    <div th:replace="common/common::footer"></div>
	<script  src='/js/toTop.js'></script>
</body>
<script>
    layui.use(['form','laypage'],function () {
        var form = layui.form, laypage = layui.laypage;

        var newsData = [];

        axios.get('/front/news/getAll').then(res => {
            newsData = res.data.data;
        })

        setTimeout(function () {
            axios.get('/front/cases/getFour').then(res => {
                layui.each(res.data.data,function (index,item) {
                    $("#jdCases").append('<div class="anli1">\n' +
                        '                        <img src="'+item.casesImage+'" alt="" width="250px" height="150px">\n' +
                        '                        <ul>\n' +
                        '                            <li class="contract">'+item.casesTypeName+'</li>\n' +
                        '                            <li>'+item.casesSimpleIntroduce.slice(0,50)+'\n' +
                        '                            </li>\n' +
                        '                            <li><a href="'+'/front/cases/detail/'+item.id+'">详情></a></li>\n' +
                        '                        </ul>\n' +
                        '                    </div>')
                })
            })

            //调用分页
            laypage.render({
                elem: 'demo20'
                ,count: newsData.length
                ,limit: 6
                ,jump: function(obj){
                    //模拟渲染
                    document.getElementById('news').innerHTML = function(){
                        var arr = []
                            ,thisData = newsData.concat().splice(obj.curr*obj.limit - obj.limit, obj.limit);
                        layui.each(thisData, function(index, item){
                            arr.push('<a href="'+'/front/newsDetail/'+item.id+'"> <img src="'+item.newsImage+'" alt="" width="70px">\n' +
                                '                            <div class="news_11">\n' +
                                '                                <h4>'+item.newsTitle+'</h4>\n' +
                                '                                <div style="padding-left: 50px">' +
                                '                                <span>作者：'+item.newsAuthor+'' +
                                '                                </span>' +
                                '                                <span>浏览：'+item.newsViewCount+'' +
                                '                                </span>' +
                                '                                </div>' +
                                '                            </div>\n' +
                                '                        </a>');
                        });
                        return arr.join('');
                    }();
                }
            });
        },400)


    })
</script>
</html>
